<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="../common.jsp"%>
<%@ page import="org.springside.core.Constants"%>
<%@ page import="cn.firstsoft.firstframe.admin.Environment"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>管理控制台 - 服务信息</title>
<%@ include file="/common/meta2.jsp"%>
<link href="../style.css" type="text/css" rel=stylesheet>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="javascript">
function openwin(url, left, top, width, height, scroll)
{
	//如果为0，就取鼠标事件位置


	x = left;
	if (x == 0)
		x = event.screenX + 20;
	//如果为0，就取鼠标事件位置


	y = top;
	if (y == 0)
		y = event.screenY + 20;

    window.open(url, "newWindow", "height=" + height + ", width=" + width + ", toolbar =no, menubar=no, scrollbars=" + scroll + ", resizable=no, location=no, status=yes, top=" + y + ", left=" + x + "") //写成一行


}

</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="#FFFFFF">
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
	<TR>
		<TD class=listViewPaginationTdS1 colSpan=20>
		服务器系统信息


		</TD>
	</TR>

    <TR>
	    <TD class=tabDetailViewDL vAlign=top width="15%">
	    机器名称:&nbsp;
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="75%">
<%
out.println(Environment.getMachineName());
%>
	    </TD>
        <TD class=tabDetailViewDF vAlign=top width="10%">
	    &nbsp;
	    </TD>
	</TR>
    <TR>
	    <TD class=tabDetailViewDL vAlign=top width="15%">
	    IP地址:&nbsp;
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="75%">
<%
out.println(request.getLocalAddr());
%>
	    </TD>
        <TD class=tabDetailViewDF vAlign=top width="10%">
	    &nbsp;
	    </TD>
	</TR>
    <TR>
	    <TD class=tabDetailViewDL vAlign=top width="15%">
	    MAC地址:&nbsp;
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="75%">
<%

//out.println(cn.firstsoft.firstframe.util.ComputerInfo.getMACAddress());
out.println(Constants.MAC);
%>
	    </TD>
        <TD class=tabDetailViewDF vAlign=top width="10%">
	    &nbsp;
	    </TD>
	</TR>
    <TR>
	    <TD class=tabDetailViewDL vAlign=top width="15%">
	    操作系统:&nbsp;
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="75%">
<%
out.println(Environment.getOS());
%> 
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="10%">
	    &nbsp;
	    </TD>
	</TR>
    <TR>
	    <TD class=tabDetailViewDL vAlign=top width="15%">
	    系统时区:&nbsp;
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="75%">
<%
out.println(System.getProperty("user.timezone") );
%> 
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="10%">
	    &nbsp;
	    </TD>
	</TR>
    <TR>
	    <TD class=tabDetailViewDL vAlign=top width="15%">
	    剩余/总计/最大:&nbsp;
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="75%">
<%
out.println(Runtime.getRuntime().freeMemory()/1024.0/1024 + "Mb / "+Runtime.getRuntime().totalMemory()/1024.0/1024 +"Mb / " + Runtime.getRuntime().maxMemory()/1024.0/1024 +"Mb" );
%> 
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="10%">
	    &nbsp;
	    </TD>
	</TR>
	
	<TR>
		<TD class=listViewPaginationTdS1 colSpan=20>
		OA应用信息
		</TD>
	</TR>
    <TR>
	    <TD class=tabDetailViewDL vAlign=top width="15%">
	    安装类型:&nbsp;
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="75%">
<%
  if (Environment.isIntegration()){
    out.println("集成安装");
  } else {
    out.println("独立安装");
  }
%> 

	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="10%">
	    &nbsp;
	    </TD>
	</TR>
	<TR>
	    <TD class=tabDetailViewDL vAlign=top width="15%">
	    JVM版本:&nbsp;
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="75%">
<%
out.println(Environment.getJvmVersion());
%> 
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="10%">
	    &nbsp;
	    </TD>
	</TR>
    <TR>
	    <TD class=tabDetailViewDL vAlign=top width="15%">
	    版本:&nbsp;
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="75%">
<%
out.println(Constants.OAVERISON);
%> 
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="10%">
	    &nbsp;
	    </TD>
	</TR>
    <TR>
	    <TD class=tabDetailViewDL vAlign=top width="15%">
	    安装路径:&nbsp;
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="75%">
<%
//out.println(System.getProperty("oa_application.config")); 
out.println(request.getRealPath("/"));
%> 
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="10%">
	    &nbsp;
	    </TD>
	</TR>
    <TR>
	    <TD class=tabDetailViewDL vAlign=top width="15%">
	    资源配置路径:&nbsp;
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="75%">
<%
//out.println(System.getProperty("oa_application.config")); 
out.println(System.getProperty("oa_application.config"));
%> 
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="10%">
	    &nbsp;
	    </TD>
	</TR>	
    <TR>
	    <TD class=tabDetailViewDL vAlign=top width="15%">
	    当前数据路径:&nbsp;
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="75%">
<%
//out.println(System.getProperty("oa_application.config")); 
out.println(Constants.MAIN_STORAGE_DIR);
%> 
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="10%">
	    &nbsp;
	    </TD>
	</TR>	
	<TR>
	    <TD class=tabDetailViewDL vAlign=top width="15%">
	    中间件/路径:&nbsp;
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="75%">
<%
out.println(Environment.getWebServerName());
out.println("&nbsp;&nbsp;/&nbsp;&nbsp;");
out.println(Environment.getWebServerPath());
%> 

	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="10%">
	    &nbsp;
	    </TD>
	</TR>
    <TR>
	    <TD class=tabDetailViewDL vAlign=top width="15%">
	    服务端口:&nbsp;
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="75%">
<form name="portForm" action="">
<%
out.println(request.getServerPort());
%>
；如果要修改端口，请填写新端口

<input type="text" size="4" name="port" value="<%=request.getServerPort() %>">
<input type="button" name="changePort" value="修改端口"
	title="在前面填写好新端口号，新的端口号不要与其他程序使用的端口冲突，否则不能正常启动！"
	onClick="if (document.portForm.port.value != '') { if (confirm('确认新端口没有冲突！是否继续？')) { openwin('server_port.jsp?port='+document.portForm.port.value,200,200,400,100,'yes'); } else { return false; } } else { alert('端口号不能为空！'); return false; }"
>
</form>
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="10%">
	    &nbsp;
	    </TD>
	</TR>
	<TR>
	    <TD class=tabDetailViewDL vAlign=top width="15%">
	    访问地址:&nbsp;
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="75%">
<form name="contextForm" action="">
<a target="_blank" href="http://<%=request.getLocalAddr()%>:<%=request.getServerPort()%><%=request.getContextPath()%>">http://<%=request.getLocalAddr()%>:<%=request.getServerPort()%><%=request.getContextPath()%></a>
；如果要修改应用路径，请填写新应用路径

<input type="text" size="6" name="context" value="<%=request.getContextPath() %>">
<input type="button" name="changeContext" value="修改应用路径"
	title="应用路径由字符和数字组成，开头必须为字符，并区分大小写，新路径不能与已经有的路径重复，否则不能正常启动！"
	onClick="if (document.contextForm.context.value != '') { if (confirm('请确认输入的路径是否正确！是否继续？')) { openwin('server_context.jsp?context='+document.contextForm.context.value,200,200,400,100,'yes'); } else { return false; } } else { alert('应用路径不能为空！'); return false; }"
>
</form>
	    </TD>
	    <TD class=tabDetailViewDF vAlign=top width="10%">
	    &nbsp;
	    </TD>
	</TR>
	</TBODY>
</TABLE>
</body>
</html>
